﻿using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace COC_helper
{
    /// <summary>
    /// 窗口之间平级递送数据预留
    /// </summary>
    public class MyPublicData
    {

    }
    /// <summary>
    /// 随从面板类:
    /// 人物是玩家在限定范围内自定义的,使用简化的模板进行操作
    /// 
    /// </summary>
    public class SlaveList 
    {
        /// <summary>
        /// 随从名称
        /// </summary>
        public string Name { get; set; }//
        /// <summary>
        /// 随从血量
        /// </summary>
        public string HP { get; set; } //
        /// <summary>
        /// 随从物品栏
        /// </summary>
        public string ThingList { get; set; }//
        /// <summary>
        /// 随从状态栏
        /// </summary>
        public string StateList { get; set; }
    }
    /// <summary>
    /// 人物编辑器类:
    /// 这里是系统人物,用在人物编辑器,这个类将被人物编辑器和会话面板同时访问
    /// </summary>
    public class PeoEdite //
    {
        /// <summary>
        /// 人物名称 
        /// </summary>
        public string Name { get; set; } //
        /// <summary>
        /// 所属派系
        /// </summary>
        public string Group { get; set; }
        /// <summary>
        /// 当前状态
        /// </summary>
        public string State { get; set; }
        /// <summary>
        /// 人物级别
        /// </summary>
        public string Type { get; set; }
        /// <summary>
        /// 人物简介
        /// </summary>
        public string Info { get; set; }
        /// <summary>
        /// 持有物品
        /// </summary>
        public string Thing { get; set; }
        /// <summary>
        /// 备注标签
        /// </summary>
        public string Tag { get; set; }
        /// <summary>
        /// 位于位置
        /// </summary>
        public string Place { get; set; }
        /// <summary>
        /// 所处会话
        /// </summary>
        public string Tale { get; set; }
        /// <summary>
        /// 人物在地图空间中的横坐标
        /// </summary>
        public int Add_X { get; set; }
        /// <summary>
        /// 人物在地图空间中的纵坐标
        /// </summary>
        public int Add_Y { get; set; }



    }
    /// <summary>
    /// 地图预览器,注意会话面板也使用这个类
    /// 
    /// </summary>
    public class MapHandle 
    {
        /// <summary>
        /// 地图文件
        /// </summary>
        public string Path { get; set; }
        /// <summary>
        /// 地图标签
        /// </summary>
        public string Label { get; set; }
        /// <summary>
        /// 地图地界归属于
        /// </summary>
        public string Belong { get; set; }
        /// <summary>
        /// 使用该地图的会话
        /// </summary>
        public string User { get; set; }
        /// <summary>
        /// 地图备注
        /// </summary>
        public string Tag { get; set; }  
    }
    /// <summary>
    /// 会话管理器,注意该页面同时读取地图类(读写)和人物编辑器(读写)
    /// </summary>
    public class SessionHandle //会话管理器,注意该管理器使用多个类
    {
        /// <summary>
        /// 会话名称或记号
        /// </summary>
        public string Name {  set; get; }
        /// <summary>
        /// 会话备注字段
        /// </summary>
        public string Tag { set; get; }
        /// <summary>
        /// 每个会话中的人物列表
        /// </summary>
        public List<PeoEdite> PeoEdites { get; set; } = new List<PeoEdite> { };
        /// <summary>
        /// 每个会话中涉及到的地图,注意一个会话只能存在一个地图
        /// </summary>
        public MapHandle MapHandle { get; set; } = new MapHandle();
        /// <summary>
        /// 会话历史轨迹与分支情况
        /// </summary>
        public string History { get; set; } = "nop";

    }
    public class MyCard //卡组管理类
    {
        public string name { get; set; } //卡牌名称
        public string group { get; set; } //卡牌所属组
        public string buff { get; set; } //卡牌效果
        public string need { get; set; } //卡牌消耗
        public string info { get; set; } //卡牌信息
        public string path { get; set; } //卡封文件
    }
    public class RelaTag //关系表示器附加数据
    {
        public string Name1 { get; set; } //大类1名称
        public string Name2 { get; set; } //大类2名称
        public int No1_Num { get; set; }  //大类1派系数量
    }
    /// <summary>
    /// 成就类
    /// </summary>
    public class Acheve
    {
        /// <summary>
        /// 成就名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 达成日期
        /// </summary>
        public string Date { get; set; }
        /// <summary>
        /// 达成条件
        /// </summary>
        public string Conn { get; set; }
        /// <summary>
        /// 达成进度
        /// </summary>
        public string Progress { get; set; }
        /// <summary>
        /// 内容介绍
        /// </summary>
        public string Description { get; set; }
    }
    /// <summary>
    /// 主数据容器类
    /// </summary>
    public class ZMB_Setting
    {
        public string Story_Name { get; set; }  //剧情名称
        public string Peo_Name { get; set; }    //主人公姓名
        public string World_Level { get; set; }//世界等级
        public int State_1 { get; set; }        //生命值
        public int State_1MAX { get; set; }        //最大生命值
        public int State_2 { get; set; }        //蓝条值
        public int State_2MAX { get; set; }        //最大蓝条值
        public int State_3 { get; set; }        //备用1
        public int State_3MAX { get; set; }        //备用一最大值
        public int State_4 { get; set; }        //备用2
        public int State_4MAX { get; set; }        //备用2最大值
        public string Money_1 { get; set; }       //货币一
        public string Money_2 { get; set; }       //货币二
        public string Money_3 { get; set; }       //货币三
        public int Skill_1 { get; set; }       //属性1
        public int Skill_2 { get; set; }       //属性2
        public int Skill_3 { get; set; }       //属性3
        public int Skill_4 { get; set; }        //属性4
        public int Skill_5 { get; set; }       //属性5
        public int Skill_6 { get; set; }       //属性6
        public int Skill_7 { get; set; }       //属性6
        public int Skill_8 { get; set; }       //属性6

        public string Skill_1str { get; set; }       //属性1名字
        public string Skill_2str { get; set; }       //属性2名字
        public string Skill_3str { get; set; }       //属性3名字
        public string Skill_4str { get; set; }       //属性4名字
        public string Skill_5str { get; set; }       //属性5名字
        public string Skill_6str { get; set; }       //属性6名字
        public string Skill_7str { get; set; }       //属性6名字
        public string Skill_8str { get; set; }       //属性6名字
        public string Cookie { get; set; }             //时间与RAM数据

        //主界面卡组
        public MyCard fontCrad { get; set; } = new MyCard();//当前页面前台持有哪张卡

        public List<object> PlayerThingList { get; set; } = new List<object>();//物品列表

        public List<object> PeopleList { get; set; } = new List<object>();    //随从列表
        /// <summary>
        /// 随从面板
        /// </summary>
        public List<SlaveList> slaveLists = new List<SlaveList>(); 
        /// <summary>
        /// 卡编辑器
        /// </summary>
        public List<MyCard> MyCard { get; set; } = new List<MyCard>(); 
        /// <summary>
        /// 关系表示器
        /// </summary>
        public List<List<string>> relaText { get; set; } = new List<List<string>>();
        /// <summary>
        /// 关系表示器附加数据
        /// </summary>
        public RelaTag relaTag { get; set; } = new RelaTag();
        /// <summary>
        /// 自定义记事本
        /// </summary>
        public string MyNoteBox { get; set; } = "";                    
        /// <summary>
        /// 人物编辑器
        /// </summary>
        public List<PeoEdite> peoEdites { get; set; } = new List<PeoEdite> { };
        /// <summary>
        /// 地图编辑器
        /// </summary>
        public List<MapHandle> MapHandles { get; set; } = new List<MapHandle>();
        /// <summary>
        /// 会话编辑器的数据集
        /// </summary>
        public List<SessionHandle> SessionHandles { get; set; } = new List<SessionHandle> { };
    
        /// <summary>
        /// 成就管理器
        /// </summary>
        public List<Acheve> Planing_acheves { get; set; } = new List<Acheve> { };





    }
    /// <summary>
    /// 使用这个类提交系统日志
    /// </summary>
    public class MyLogHandle
    {
        public void LogPush(string context,string Level)
        {
            try
            {
                File.AppendAllText(Global_Value.ZMB_PATH + DateAndTime.DateString + "_System.log", DateAndTime.TimeString + " -[" + Level + ']' + context+"\r\n",Encoding.UTF8);
            }
            catch (Exception)
            {

                //throw;
            }
            

        }
    
    }
    
    /// <summary>
    /// 公共变量区,请严格按照计划访问
    /// </summary>
    public class Global_Value
    {
        /// <summary>
        /// 总文件路径
        /// </summary>
        public static string ZMB_PATH; //文件总路径
        /// <summary>
        /// 主变量,请严格按照计划访问
        /// </summary>
        public static ZMB_Setting zmb_Setting = new ZMB_Setting(); //主变量
        /// <summary>
        ///  窗口关闭时提交给上一级的日志报文,禁止多线程使用
        /// </summary>
        public static string CallBackLog;

        public static MyLogHandle MyLogHandle = new MyLogHandle();
    }
    

}
